<%@include file="top.jsp"%>

<jsp:useBean id="user" type="mvc.User" scope="session" />
<jsp:useBean id="news" type="mvc.News" scope="session" />
<center>
	<table width="560" border="0">
		<tr>
	      <td><h3>MayClub News</h3><hr style="border:dashed #676767; border-width:1px 0 0 0; height:1;"></td>
	    </tr>
	</table>
<table width="560" border="0">
<%
// Get data from news bean
int pageCount = news.getPageCount();
int totalPages = news.getTotalpages();
Iterator<NewsPost> it = news.getAllNewsPosts();
// Loop
while(it.hasNext()){
NewsPost a = it.next();
%>
<tr>
	<td style="WORD-BREAK:BREAK-ALL"  align="left">
	<b><h3><a href="/servlet/mvc.Servl?state=news&fullnews=<%=a.getId()%>"><%=a.getTopic()%></a></h3></b>
	<br>	
	<%=a.getText()%>
<br><br>
	Posted by<b> <%=a.getName()%></b> on <%=a.getDate()%>
	<%if(user.isAdmin()){%> - <a href="/servlet/mvc.Servl?state=news&remove=<%=a.getId()%>">Remove this news post</a><%}%>
	<br><hr style="border:dashed #676767; border-width:1px 0 0 0; height:1;">	
	</td>
</tr>
<%}// For the navigator
String inc = "news";%>
</table>
<%@include file="navigator.jsp"%>
</center>
<%@include file="bottom.jsp"%>

